<%@page import="fr.u.psud.polytech.view.LinkGenerator"%>
<%@page import="fr.u.psud.polytech.view.ressources.ErrorCode"%>
<%@page import="fr.u.psud.polytech.view.PasswordChecker"%>
<%@page import="fr.u.psud.polytech.view.ressources.ActionType"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%
String login = (String)session.getAttribute("login");
String password = (String)session.getAttribute("password");

if(login == null || password == null)
{
	response.sendRedirect("/GestionnaireDeStock/Acceuil.jsp?error="+ErrorCode.ERROR_LOGIN);
}

//On poste les variables pour l'oouverture de la prochaine page
session.setAttribute("login", login);
session.setAttribute("password", password);

//Verification du login et du mot de passe
if(!new PasswordChecker().checkUser(login, password, ActionType.STOCK))
{
	response.sendRedirect("/GestionnaireDeStock/Acceuil.jsp?error="+ErrorCode.ERROR_LOGIN);
}

String link = new LinkGenerator().getLinkGenerator(login);

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css" media="screen">
		@import url( css/style.css );
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Gestionnaire de stock des entrepots</title>
<link rel="icon" type="image/png" href="img/colis.png" />
</head>
<body>
	<div id="header">
		<center>
			<table>
			<tr>
				<td><img src="img/colis.png"></td>
				<td>Gestionnaire du stock des entrepots</td>
				<td><img src="img/colis.png"></td>
			</tr>
			</table>
		</center>
	</div>
	<div id="link">
		<%= link %>
	</div>
	<div id="content">
		<center>
	
		</center>
	</div>
	<div id="footer">
		Copyright 2011 - Polytech Paris Sud - <a href="http://www.polytech.u-psud.fr/">www.polytech.u-psud.fr</a>
	</div>
	
</body>
</html>